using System;
using System.Collections.Generic;

public class SuccessItem
{
    public int ItemId { get; set; }
    public int BrandId { get; set; }
    public string Name { get; set; }
    public string Sku { get; set; }
    public string Specifications { get; set; }
    public string SupplierPartId { get; set; }
}

public class ErrorItem
{
    public int ItemNum { get; set; }
    public string FailureReason { get; set; }
    public string SupplierPartId { get; set; }
}

public class UploadResult
{
    public List<SuccessItem> SuccessList { get; set; }
    public List<ErrorItem> ErrorList { get; set; }
}

public class SupplierService
{
    // 模拟从数据库获取成功上传结果
    private List<SuccessItem> getSuccessList(string code = null)
    {
        return new List<SuccessItem>
        {
            new SuccessItem
            {
                ItemId = 159793059,
                BrandId = 3041,
                Name = "圆形滤毒盒",
                Sku = "个",
                Specifications = "防护类型:酸性气体和蒸汽等",
                SupplierPartId = "KT11-990-154"
            }
        };
    }

    // 模拟从数据库获取失败上传结果
    private List<ErrorItem> getErrorList(string code = null)
    {
        return new List<ErrorItem>
        {
            new ErrorItem
            {
                ItemNum = 1,
                FailureReason = "图片审核不通过，请更换图片",
                SupplierPartId = "KT11-990-152"
            },
            new ErrorItem
            {
                ItemNum = 2,
                FailureReason = "图片审核不通过，请更换图片",
                SupplierPartId = "KT11-990-153"
            }
        };
    }

    public UploadResult GetUploadResults(string code = null)
    {
        var result = new UploadResult
        {
            SuccessList = getSuccessList(code),
            ErrorList = getErrorList(code)
        };
        return result;
    }
}